﻿using System.Collections.Generic;

namespace Exercise11
{
    internal class MyStr
    {
        public List<int> ListNum;        
        public User UserCtrl;
        public User InStrFindNum(string Instring)
        {
            UserCtrl = new User(false, "Sucess");
            if (string.IsNullOrEmpty(Instring)){ UserCtrl.bIsNull = true;  UserCtrl.StrMsg = "Is null"; return UserCtrl; }
            ListNum = new List<int>();
            for (int i = 0; i < Instring.Length; i++){
                if (char.IsDigit(Instring[i])) { ListNum.Add(i); }
            }
            if (ListNum.Count == 0) { UserCtrl.bIsNull = true; UserCtrl.StrMsg = "Not number"; return UserCtrl; }
            return UserCtrl;
        }
    }
}
